<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<c:set var="contextPath" value="${pageContext.request.contextPath}"/>
<script language="javascript" type="text/javascript" src="${contextPath}/resources/niceforms.js"></script>
<jsp:include page="/common/load_resources.jsp" />
<title><spring:message code="label.enrollUser.Title"/></title>
<body>
<div id="container">
<form:form action="createUser.do" method="post" modelAttribute="userForm" cssClass="niceform" id="userForm">

	<fieldset>
    	<legend><spring:message code="label.enrollUser.Title"/></legend>
    	<table>
        <tr>
        	<td class="formLabel"><label for="name"><spring:message code="label.enrollUser.name"/></label></td>
            <td class="formInput"><form:input path="name"/>&nbsp;&nbsp;<form:errors path="name" cssClass="form-error-message"/></td>
        </tr>
        <tr>
        	<td class="formLabel"><label for="userName"><spring:message code="label.enrollUser.userId"/></label></td>
            <td class="formInput"><form:input path="userName"/>&nbsp;&nbsp;<form:errors path="userName" cssClass="form-error-message"/></td>
        </tr>
        
        <tr>
        	<td class="formLabel"><label for="corporationOid"><spring:message code="label.enrollUser.firm"/></label></td>
            <td class="formInput">
            	<form:select path="corporationOid">
					<c:forEach items="${firms}" var="firm">
						<form:option value="${firm.oid }" label="${firm.name }"/>
					</c:forEach>
				</form:select>
            </td>
        </tr>
        
        <tr>
        	<td class="formLabel"><label for="password"><spring:message code="label.enrollUser.password"/></label></td>
            <td class="formInput"><form:password path="password"/>&nbsp;&nbsp;<form:errors path="password" cssClass="form-error-message"/></td>
        </tr>
        </table>
    </fieldset>

	<fieldset class="action">
		<dt><label for="submit"></label></dt>
    	<input type="submit" name="submit" id="submit" value="<spring:message code="label.enrollUser.enrollUserButton"/>" />
    	
    	<a href="${backUrl}">Back</a>
    </fieldset>
</form:form>
</div>
</body>
</html>